% 创建时间：2025-06-20 23:27:50
% 作者：兪馳
clc;
clear;

A=[-2,2,1;
    -1,0,-1;
    1,-1,2]; 

B=[-2,-1,2;
    1,3,0;
    3,-2,2];

Q=[0,-1,0;
    -1,1,0;
    1,-1,-1]; 
x=inv(sym(eye(9))-kron(B',A))*Q(:);
X=reshape(x,3,3), 
norm(A*X*B - X + Q)